<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style type="text/css">
			.active{
				color: red;
			}
			.line{
				color :aqua;
			}
		</style>
	</head>
	<body>
		<div id="app">
            <!--
v-bind:class="{类名1: true,类名2: false}">  这个 表示  类名1这个class属性会被添加到当前标签中，类名2不会被添加到标签中
即是说 当前标签中 存在 class="类名1"
-->
			<h2 :class="{active:isActive,line:isLine}">{{message}}</h2>
			<button type="button" @click="btnClick">按钮</button>

		</div>

		<script src="../vue.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript">
			const app = new Vue({
				el: '#app',
				data: {
					message:'你好！',
					isActive:true,
					isLine:false
				},
				methods:{
					btnClick:function(){
						this.isActive=!this.isActive
						this.isLine = !this.isLine
					}
				}
			});
		</script>
	</body>
</html>
